/*    */ package com.zimbra.cs.imap;
/*    */ 
/*    */ import java.util.Date;
/*    */ import java.util.List;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class AppendCommand
/*    */   extends ImapCommand
/*    */ {
/*    */   private ImapPath path;
/*    */   private List<AppendMessage> appends;
/*    */   
/*    */   public AppendCommand(ImapPath path, List<AppendMessage> appends)
/*    */   {
/* 34 */     this.path = path;
/* 35 */     this.appends = appends;
/*    */   }
/*    */   
/*    */   protected boolean hasSameParams(ImapCommand command)
/*    */   {
/* 40 */     if (equals(command)) {
/* 41 */       return true;
/*    */     }
/* 43 */     AppendCommand other = (AppendCommand)command;
/* 44 */     if ((this.path != null) && (this.path.equals(other.path))) {
/* 45 */       if (this.appends != null) {
/* 46 */         if ((other.appends == null) || (this.appends.size() != other.appends.size())) {
/* 47 */           return false;
/*    */         }
/*    */         
/*    */ 
/* 51 */         for (int i = 0; i < this.appends.size(); i++) {
/* 52 */           AppendMessage myMsg = (AppendMessage)this.appends.get(i);
/* 53 */           AppendMessage otherMsg = (AppendMessage)other.appends.get(i);
/* 54 */           if (((myMsg.getDate() != null) && (!myMsg.getDate().equals(otherMsg.getDate()))) || ((myMsg.getDate() == null) && (otherMsg.getDate() != null)))
/*    */           {
/* 56 */             return false;
/*    */           }
/* 58 */           if (((myMsg.getPersistentFlagNames() != null) && (!myMsg.getPersistentFlagNames().equals(otherMsg.getPersistentFlagNames()))) || ((myMsg.getPersistentFlagNames() == null) && (otherMsg.getPersistentFlagNames() != null)))
/*    */           {
/*    */ 
/* 61 */             return false;
/*    */           }
/*    */           
/* 64 */           List<AppendMessage.Part> myParts = myMsg.getParts();
/* 65 */           List<AppendMessage.Part> otherParts = otherMsg.getParts();
/* 66 */           if (((myParts == null) && (otherParts != null)) || ((myParts != null) && (otherParts == null)) || (myParts.size() != otherParts.size()))
/*    */           {
/* 68 */             return false;
/*    */           }
/* 70 */           for (int j = 0; j < myParts.size(); j++) {
/* 71 */             AppendMessage.Part myPart = (AppendMessage.Part)myParts.get(j);
/* 72 */             AppendMessage.Part otherPart = (AppendMessage.Part)otherParts.get(j);
/*    */             
/* 74 */             if (((myPart.getLiteral() != null) && (otherPart.getLiteral() != null) && (myPart.getLiteral().size() != otherPart.getLiteral().size())) || ((myPart.getLiteral() == null) && (otherPart.getLiteral() != null)) || ((myPart.getLiteral() != null) && (otherPart.getLiteral() == null)))
/*    */             {
/*    */ 
/*    */ 
/* 78 */               return false;
/*    */             }
/*    */             
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/* 85 */             if (((myPart.getUrl() != null) && (!myPart.getUrl().equals(otherPart.getUrl()))) || ((myPart.getUrl() == null) && (otherPart.getUrl() != null)))
/*    */             {
/* 87 */               return false;
/*    */             }
/*    */           }
/*    */         }
/* 91 */         return true;
/*    */       }
/*    */       
/* 94 */       return other.appends != null;
/*    */     }
/*    */     
/* 97 */     return false;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/imap/AppendCommand.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */